#ifndef InclusionGuard_SoundPotSoundHost_h
#define InclusionGuard_SoundPotSoundHost_h

#include <string>
#include "juce.h"
#include "SoundPotSound.h"
#include "SoundPotInstrumentDao.h"
#include "SoundPotInstrumentResponder.h"
#include "pluginterfaces/vst2.x/aeffectx.h"
#include <list>
#include <map>

namespace SoundPot
{


	class SoundHost : InstrumentResponder
	{
	public:
		
		SoundHost(InstrumentDao* instrumentDao, InstrumentResponder* responder);
		
		~SoundHost();

		/// Adds a sound to the host.
		void addSound(Sound* sound);

		/// Removes a sound from the host.
		void removeSound(Sound* sound);

		/// Replaces an old sound with a new one.
		void replaceSound(Sound* oldSound, Sound* newSound);

		/// Removes all previous sounds and adds the new ones.
		void replaceAllSounds(std::list<Sound*>& newSounds);

		/// Suspends all sounds
		void suspendAllSounds();

		/// Wakes up all sounds
		void wakeUpAllSounds();

		/// Sets the sample rate for all sounds
		void setSampleRate(const float& value);

		/// Sets the maximum block size for all sounds
		void setMaxBlockSize(const int& value);

		/*
		/// Sets the global parameter to the specified value
		void setGlobalParameter(const int& globalIndex, const float& value);

		/// Gets the value of a global parameter
		float getGlobalParameter(const int& globalIndex) const;

		/// Returns whether the specified global parameter may be automated by the host
		bool canGlobalParameterBeAutomated(const int& globalIndex) const;

		/// Gets additional info about the specified parameter
		void getGlobalParameterProperties(const int& globalIndex, VstParameterProperties* outProperties) const;

		/// Gets the label (e.g. unit) of a global parameter
		std::string getGlobalParameterLabel(const int& globalIndex) const;

		/// Gets the value of a global parameter formatted as a string (e.g. deep, high)
		std::string getGlobalParameterDisplay(const int& globalIndex) const;

		/// Gets the name of a global parameter
		std::string getGlobalParameterName(const int& globalIndex) const;

		/// Gets additional information about an output channel
		void getOutputProperties(const int& channelIndex, VstPinProperties* outProperties) const;

		/// Tries to set speaker arrangement
		bool setSpeakerArrangement(VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput);

		/// Gets available speaker arrangements?
		bool getSpeakerArrangement(VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput);

		/// Gets the number of sounds
		int getNumberOfSounds() const;
		*/

		// Temporary methods
		// Todo: Remove or place into other class
		bool instrumentsMayChange() const
		{
			return true;
		}


		// InstrumentResponder methods

		float getCurrentSampleRate();
		int getMaxBlockSize();





	private:

		/// InstrumentDao
		InstrumentDao* instrumentDao;

		/// Responder
		InstrumentResponder* responder;

		/// Loaded instruments
		std::list<Instrument*>* loadedInstruments;

		/// Creates and adds an instrument and marks it as unemployed.
		Instrument* createAndAddInstrument(const std::string& instrumentID);

		/// Removes and deletes an unemployed instrument.
		void removeAndDeleteInstrument(Instrument* instrument);

		/// Returns an unemployed instrument with the given instrumentID
		Instrument* getUnemployedInstrument(const std::string& instrumentID);







		
	};
}


#endif